export const formatTime = (time: string | number | Date, fmt: string): string => {

        if (!time) return ''

        const date = new Date(time)

        const o: any = {
                Y: date.getFullYear(),
                M: date.getMonth() + 1,
                D: date.getDate(),
                h: date.getHours(),
                m: date.getMinutes(),
                s: date.getSeconds()
        }

        for (let k in o) {

                const t = o[k] < 10 ? '0' + o[k] : o[k]

                fmt = fmt.replace(k, t)

        }

        return fmt
}
